package com.example.demo.dao;

import com.example.demo.pojo.Student;
import org.apache.ibatis.annotations.*;


import java.util.List;

@Mapper     //把对象当成xml文件解析
public interface StudentMapper {

    @Select("select * from student where age=#{age}")
    public List<Student> findStudentByAge(Integer age);
    @Insert("insert into student(name,age,sex,hobby) values(#{name},#{age},#{sex},#{hobby})")
    public boolean insertStudent(Student student);
    @Select("select * from student")
    public  List<Student> selectStudentAll();
    @Delete("delete from student where id=#{id}")
    public boolean deleteStudent(int id);
    @Update("update student set name=#{name},age=#{age},sex=#{sex},hobby=#{hobby} where id=#{id}")
    public  boolean updateStudent(Student student);
}
